﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<QLPKWeb.Models.FormBean.HomeMoDel.HomeForm>" %>
<%@ Import Namespace="DONGACS.Common" %>


<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript" language="javascript" src="<%= ResolveUrl("~/Content/Scripts/LichLamViec/ViewLich.js") %>"></script>
    <script type="text/javascript" language="javascript" src="<%= ResolveUrl("~/Content/Scripts/KiemTra.js") %>"></script>

    <script language="javascript" type="text/javascript">
//        $(document).ready(function () {
//            selectMenu("LichLamViec-DangKyLich");
//            $("#LichLamViec-DangKyLich").parent().attr("class", "opened");
//        });
        $(document).ready(function () {
            //            $("#ToDate").datepicker({ dateFormat: 'dd/mm/yy' });
            $("#FromDate").datepicker({ dateFormat: 'dd/mm/yy' });

            //onclick = 'javascript:XemLich(" + item.ID + ")'
        });
        
    </script>
     <%--  <script type="text/javascript" src="../Shared/res.axd?v=56.0"></script>
     <script type="text/javascript">
         jQuery(function () {
             var mcClient = new MangoChatClient();
             mcClient.start();
         });
         var basePath = '<%=ResolveUrl("~/") %>';
         var strSplit = "||||||";

     </script>--%>
    <form id="form" method="post" action="#">
    <input type="hidden" id="IdDepartment" name="IdDepartment" value="0"/>
    <input type="hidden" id="Type" name="Type" value="-3"/>
    <div class="box round first fullpage">
            <h2> Calender </h2>
     <div class="divhomeLichLamViec">  
           <table style="width: 100%"class="data display datatable" >
                <tr>
                    <td colspan="4" style="padding-top: 20px;">
                        <span style="display:inline;">Select dates</span>
                        <input name="FromDate" id="FromDate" type="text" 
                            value="<%= Model.FromDate != null ? Model.FromDate.Value.ToString("dd/MM/yyyy") : DateTime.Now.ToString("dd/MM/yyyy") %>" 
                            style="display: inline;" />
            
                        <input type="button" value="Xem" onclick="javascript:DoView();" style="display: inline;" />
                    </td>
                </tr>
                <tr>
                    <td style="font-size: 13px; font-weight: bold">
                        <img src="../../Content/img/tailieu.jpg" />
                      
                        <a style="cursor: pointer" onclick="javascript:DoViewLichSo();" class="red" id="menuaLichSo" >Calender Company</a>&nbsp;|&nbsp;
                        <a  style="cursor: pointer"onclick="javascript:DoViewTruongPhong(-2);" id="menuaLanhDaoSo" >Leadership </a>
                        &nbsp;|&nbsp;<a  style="cursor: pointer"onclick="javascript:DoViewTruongPhong(0);" id="menuaTruongPhong" >Director department</a>&nbsp;|&nbsp;
                        <a  style="cursor: pointer"onclick="javascript:DoViewChuenVien();" id="menuaChuyenVien">Employee</a>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <div id="LichChuyenVien"></div>
                    </td>
                </tr>
                <tr>
                    <td colspan="4" style="padding-top: 10px;">
                        <div id="ViewLich">
                        <table width="100%"style="height: 350px;"  cellpadding="0" cellspacing="0"  border="1" class="data display datatable">
                            <tr>
                            <td  style="border: 1px solid #ddd "nowrap="nowrap" align="center">
                                <strong>
                                    Date
                                </strong>
                            </td>
                            <td  style="border: 1px solid #ddd "nowrap="nowrap" align="center">
                                <strong>
                                    Time
                                </strong>
                            </td>
                            <td  style="border: 1px solid #ddd "nowrap="nowrap" align="center">
                                <strong>
                                    Contents
                                </strong>
                            </td>
                            <td  style="border: 1px solid #ddd "nowrap="nowrap" align="center">
                                <strong>
                                    Division
                                </strong>
                            </td>
                        </tr>
                        <% for (int i = 1; i < 7; i++)
                           {
                               //List<QLPKWeb.Models.LinQ.LichLamViec.LichLamViec> listLich = Model.ListLichDaDuyet
                               //    .Where(p => (int)p.EventDate.Value.DayOfWeek == i).ToList();
                               List<QLPKWeb.Models.LinQ.LichLamViec.LichLamViec> listLich = Model.ListLichDaDuyet
                                  .Where(p => (int)p.StartTime.Value.DayOfWeek == i).ToList();
                                %>
                        <tr>
                            <td  style='padding-left:3px;border: 1px solid #ddd' align='center' nowrap='nowrap' width='35px'>
                                <%= "No " + (i + 1).ToString() %>
                            </td>
                            <td  style='padding-left:3px;border: 1px solid #ddd' align='left' nowrap='nowrap' width='260px'>
                                <%
                               foreach (QLPKWeb.Models.LinQ.LichLamViec.LichLamViec item in listLich)
                               {
                                   %>
                                   <%--<%= item.StartTime != null ? item.StartTime.Value.ToString("HH:mm") : "" %>
                                   <span> - </span>
                                   <%= item.EndTime != null ? item.EndTime.Value.ToString("HH:mm") : ""%>
                                   <br />--%>
                                   <%= item.StartTime != null ? "- " + "<b>" + item.StartTime.Value.ToString("HH:mm") + "</b> Date <b>" + item.StartTime.Value.ToString("dd/MM/yyyy") + "</b>"  : ""%>
                                   <span> - </span>
                                   <%= item.EndTime != null ? "<b>" + item.EndTime.Value.ToString("HH:mm") + "</b> Date <b>" + item.EndTime.Value.ToString("dd/MM/yyyy") + "</b>" : ""%>
                                   <br />
                                   <%
                               }
                                %>
                            </td>
                            <td style='padding-left:3px;border: 1px solid #ddd' align="left" nowrap='nowrap'>
                                <%
                               foreach (QLPKWeb.Models.LinQ.LichLamViec.LichLamViec item in listLich)
                               {
                                   %>
                                   <span> - </span>
                                   <a style="color: blue; cursor: pointer" title="<%=item.NoiDung %>" onclick="javascript:window.location.href = basePath + 'LichLamViec/XemLichLamViec/<%= item.ID %>'">
                                       <%= ConvertUtils.TruncateAtWord(item.NoiDung,75) %>
                                   </a>
                                   <br />
                                   <%
                               }
                                %>
                            </td>
                            <td style='padding-left:3px;border: 1px solid #ddd' align="left" nowrap='nowrap'>
                                <%
                               foreach (QLPKWeb.Models.LinQ.LichLamViec.LichLamViec item in listLich)
                               {
                                   %>
                                   <span> - </span>
                                   <%= Model.GetDisplayNameOfThanhPhan(item.LichLamViecShareds.ToList(),2) %>
                                   <br />
                                   <%
                               }
                                %>
                            </td>
                        </tr>
                        <%
                           } %>
                        </table>
                        </div>
                    </td>
                </tr>
            </table>  
        </div>
    </div>
    </form>

    <div style='width:250px; height:180px;display:none; z-index:100000;  position:absolute; border:5px solid #ddd; background:#fff; padding:4px' id="ViewThanhPhan">
        <div style='width:100%; height:10px;'>
        <img src="<%=ResolveUrl("~/Content/img/publish_x.png")%>" style='float:right; margin:3px; cursor:pointer;' title='close' 
            onclick='$("#ViewThanhPhan").css("display", "none")'>
        </div>
        <div style='width:100%; height:90px; overflow:auto'>
            <div id="tbl_DanhSachThanhPhan">
                <table>
                    <tbody>
                               
                    </tbody>
                </table>
            </div>
        </div>
        <div class="pagebreak"> &nbsp;</div>
        <div style="text-align:center"><input type="button" id="Button1" name="OK" value="OK" class="button1" onclick='$("#ViewThanhPhan").css("display", "none")'/></div>
    </div>
</asp:Content>
